<template>
  <div class="">
    <van-nav-bar
      title="我的地址"
      left-text=""
      right-text="新建地址"
      left-arrow
      @click-left="$router.go(-1)"
      @click-right="$router.push('/addadress')"
    />
    <h1>地址列表页面</h1>

    <!-- 列表要自己写 -->
    <!-- 拿到list数据自己渲染 -->
    <ul>
      <li v-for="item in list">{{ item.address }}=== {{ item.linkMan }}</li>
    </ul>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router";
import { getAdressList } from "../../utils/shopcar.js";
export default {
  setup(props, ctx) {
    const store = useStore();
    const router = useRouter();
    const route = useRoute();
    const data = reactive({
      list: [],
    });
    getAdressList().then((res) => {
      console.log(res);
      data.list = res.data;
    });

    return { ...toRefs(data) };
  },
};
</script>

<style lang="scss"></style>
